var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
Page({

  data: {
    // 审核列表
    applyList: [],
    // 设备是否为苹果X
    isIphoneX: 0,
    // 加载图标的位置
    sysHeight: 0,
    // 控制加载
    loading: 0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 获取设备信息
    let phone = wx.getStorageSync('isIphoneX')
    if (phone) {
      this.setData({
        isIphoneX: 1
      })
    }
  },
  onShow: function () {
    // 获取设备信息
    let info = wx.getSystemInfoSync();
    let sysHeight = info.windowHeight - 100;
    this.setData({
      sysHeight: sysHeight,
    });
    this.getTeamOpinion()
  },
  getTeamOpinion() {
    let that = this;
    let userID = wx.getStorageSync('userID')
    util.requestApi(api.getTeamOpinion, {
      userID: userID
    }).then(function (res) {
      if (res.code == 200) {
        that.setData({
          applyList: res.content,
          loading: 1
        })
      }
    })
  },
  goToApply() {
    wx.navigateTo({
      url: '../toApply/toApply',
    })
  }
})